﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NGinnBPM.Runtime.Events
{
    /// <summary>
    /// Notification about unexpected child task failure,
    /// sent when the child task is marked 'FailedActive' by it's parent task instance.
    /// </summary>
    [Serializable]
    public class ChildTaskFailedNotification : DiagnosticEvent
    {
        public ChildTaskFailedNotification()
        {
            this.Severity = EventSeverity.Warn;
            this.Category = "NGinnBPM.Runtime.Tasks";
        }

        public ChildTaskFailedNotification(string childInstance, string parentInstance, string errorInfo)
        {
            this.Severity = EventSeverity.Warn;
            this.Category = "NGinnBPM.Runtime.Tasks";
            InstanceId = childInstance;
            ParentTaskInstanceId = parentInstance;
            ErrorInfo = errorInfo;
        }

        public string InstanceId { get; set; }
        public string ParentTaskInstanceId { get; set; }
    }
}
